<template>
  <div class="mobileCrusherList">
    <div class="banner">
      <img src="../../../static/images/productBanner.jpg">
    </div>
    <div class="ListContane">
      <el-row :gutter="20" class="listNav">
        <el-col :span="12">
          <div class="grid-content">
            <router-link to="/products/Mobile-Crusher" class="linkActive">
              Mobile Crushers
            </router-link>
          </div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content">
            <router-link to="/products/Crushing-Plant">
              Stationary Crushers
            </router-link>
          </div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content">
            <router-link to="/products/Grinding-MIll">
              Grinding Mill
            </router-link>
          </div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content">
            <router-link to="/products/Screening-Washing">
              Washing & Screening
            </router-link>
          </div>
        </el-col>
        <el-col :span="12">
          <div class="grid-content">
            <router-link to="/products/Ore-Benefication">
              Ore Beneficiation
            </router-link>
          </div>
        </el-col>
      </el-row>
      <el-row :gutter="20" class="mobileList">
        <el-col :span="12" v-for="item in mobileList" :key="item.id">
          <router-link :to="'/product/' + (item.id)">
            <div class="grid-content proImg">
              <img :src="changeImgpath(item.proimg)">
            </div>
            <h3>{{item.title}}</h3>
          </router-link>
        </el-col>
      </el-row>
      <div class="page">
        <el-pagination
        background
        layout="prev, pager, next"
        @current-change="handleCurrentChange"
        :total="total">
        </el-pagination>
      </div>
    </div>
  </div>
</template>
<script>
import axios from 'axios'
export default {
  data () {
    return {
      activeName: 'first',
      mobileList: {},
      total: null
    }
  },
  mounted () {
    axios.get('/product/list/mobile').then(response => {
      this.mobileList = response.data.data.data
      this.total = response.data.data.count
    }).catch(function (error) {
      console.log(error)
    })
  },
  methods: {
    handleClick (tab, event) {
      console.log(tab, event)
    },
    changeImgpath (img) {
      img = '//www.kefid.com' + img
      return img
    },
    handleCurrentChange (val) {
      console.log(val)
    }
  }
}
</script>
<style scoped>
.mobileCrusherList{
  margin-top: 52px;
}
.mobileList a{
  color: #333;
}
.mobileCrusherList .ListContane{
  padding: 0 1rem;
}
.ListContane{
  margin-top: 0.8rem;
}
.ListContane .proImg img{
  width: 100%;
  height: auto;
}
.ListContane .listNav .el-col-12{
  margin-bottom: 1rem;
}
.ListContane .listNav .el-col-12 a{
  color: #333;
  padding: 0.8rem 0;
  display: block;
  background: #f7f7f7;
  text-align: center;
  font-size: 1.4rem;
  border-radius: 0.5rem;
  border: 1px solid #ccc;
}
.ListContane .listNav .el-col-12 a.linkActive{
  color: #db3f28 !important;
}
.page{
  text-align: center;
  margin: 1rem 0;
}
</style>
